#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QImage>
#include <QButtonGroup>
#include <QThread>
#include "usbdeviceworker.h"

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

private:
    Ui::Widget *ui;

    QImage* img_led_r;
    QImage* img_led_g;
    QImage* img_led_y;


    QButtonGroup *btnGroupLearn;
    uint8_t LearnModel;

    void OutputMessage(QString str);

    QThread UsbDeviceThread;
    UsbDeviceWorker* UsbDeviceWork;

public slots:
    void LearnModeSelect(void);

    void ReceiveThreadMsg(uint8_t* Msg);

private slots:
    void on_BT_ReadPara_clicked();
    void on_BT_WritePara_clicked();

signals:
    void operate(const QString &);
    void SendMsgToUsbThread(uint8_t* buff);

};
#endif // WIDGET_H
